class Singleton {

    private static Singleton singleton = new Singleton();

    public static Singleton getSingleton() {
        return singleton;
    }

    private Singleton() {

    }
}

public class Demo2 {

    public static void main(String[] args) {

      Singleton s = Singleton.getSingleton();
//      Singleton s1 = new Singleton();
    }
}
